<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%> 
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }" />
<jsp:include page="inc.jsp" /> 
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			$(function(){
				$('#pp').portal({
					border:false,
					fit:true
				});
				addPanel();
				
				$('#tableNotice').datagrid({
					border:false,
					fit:true,
					singleSelect:true,
					url:'${ctx}/nc/findNotice.coc',
					rownumbers:true,
					columns:[[
					   {field:'ck',checkbox:true},
					   {field:'title',title:'标题',width:120},
					   {field:'showDate',title:'发布时间',width:75},
					   {field:'endDay',title:'截止时间',width:65},
					   {field:'active',title:'操作',align:'center',
						 formatter:function(v,r,i){
							 return '<a href="#" onclick="checkNotice('+i+')">查看</a>'
						 }   
					   }
					 ]]
				});
			});
			function checkNotice(index){
				$('#tableNotice').datagrid('selectRow',index);
				var row = $('#tableNotice').datagrid('getSelected');
				parent.$.modalDialog({
					title:'查看通知',
					href:'${ctx}/nc/lookNotice/'+row.id+'.coc',
					width:780,
					height:550
				});
			}
			function addPanel(){
				var p = $('<div></div>').appendTo('body');
				p.panel({
					title:'测试窗口01',
					height:420,
					//href:'${ctx}/pc/pie.coc',
					closable:true,
					content:'<iframe src="${ctx}/pc/pie.coc" scrolling="no" frameborder="0" style="width: 100%;height: 99%;"></iframe>'
				});
				$('#pp').portal('add',{
					panel:p,
					columnIndex:0
				});
				$('#pp').portal('resize');
			}
		</script>
		<div id="pp" style="position: relative;height: 500px;">
			<div style="width: 62%;"></div>
			
			<div style="width: 35%;">
				<div class="easyui-panel" title="通知列表" 
					closable="false" style="height:230px;">
					<table id="tableNotice"></table>
				</div>
			</div>
		</div>
	</body>
</html>
